#include "Environment.h"

using namespace GalliumEngine;

Environment::Environment(void)
{
	numPointLights = 0;
	numSpotLights = 0;

	lightingEnabled = 1;

	directionalLight = new DirectionalLight();
}


Environment::~Environment(void)
{
}

void Environment::setDirectionalLight(DirectionalLight* _light)
{
	directionalLight = _light;
}

DirectionalLight* Environment::getDirectionalLight()
{
	return directionalLight;
}

void Environment::addPointLight(PointLight* _light)
{
	if(numPointLights < MAX_POINT_LIGHTS)
	{
		numPointLights++;
		pointLights.push_back(_light);
	}
}

PointLight* Environment::getPointLight(int i)
{
	int temp = (i >= MAX_POINT_LIGHTS ? MAX_POINT_LIGHTS-1 : i);
	return pointLights[temp];
}

void Environment::addSpotLight(SpotLight* _light)
{
	if(numSpotLights < MAX_SPOT_LIGHTS)
	{
		numSpotLights++;
		spotLights.push_back(_light);
	}
}

SpotLight* Environment::getSpotLight(int i)
{
	int temp = (i >= MAX_SPOT_LIGHTS ? MAX_SPOT_LIGHTS-1 : i);
	return spotLights[temp];
}

void Environment::setLightingEnabled(bool _enabled)
{
	lightingEnabled = (_enabled ? 1 : 0);
}

int Environment::getLightingEnabled()
{
	return lightingEnabled;
}

int Environment::getNumPointLights()
{
	return numPointLights;
}

int Environment::getNumSpotLights()
{
	return numSpotLights;
}